#ifndef APP_BLUETOOTH_H
#define APP_BLUETOOTH_H

#include "app_device.h"

typedef enum
{
    BT_BR_9600 = '4',
    BT_BR_115200 = '8',
} BTBraudRate;
;

/**
 * 测试蓝牙是否可用
 */
int app_bluetooth_status(Device *device);

/**
 * 设置蓝牙名称
 */
int app_bluetooth_rename(Device *device, char *name);

/**
 * 设置蓝牙波特率
 */
int app_bluetooth_setBaudrate(Device *device, BTBraudRate baudrate);

/**
 * 重置蓝牙
 */
int app_bluetooth_reset(Device *device);

/**
 * 设置蓝牙网络ID
 */
int app_bluetooth_setNetID(Device *device, char *net_id);

/**
 * 设置蓝牙MAC地址
 */
int app_bluetooth_setMaddr(Device *device, char *maddr);

/**
 * 处理读取的蓝牙数据
 */
int app_bluetooth_postRead(Device *device, char *data, int len);

/**
 * 处理将要发送的蓝牙数据
 */
int app_bluetooth_preWrite(Device *device, char *data, int len);
#endif // APP_BLUETOOTH_H
